<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<style type="text/css">
#ciCategoryTree {
	
}

#ciCategoryTree li {
	float: left; padding: 5px
}

#ciCategoryTree li .switch {
	display: none
}
</style>
<script type="text/javascript">
	function ciCategoryTree_onNodeClick(event, treeId, treeNode) {

		ciGrid.search({
			"field" : "conf_category_id",
			"op" : "eq",
			"data" : treeNode.id
		});
	}

	 
	function getSelectRow() {
		var rowData = ciGrid.getRowData();
		if (rowData)
			window.parent.${ctId}.setCustomerCiValue(rowData.id, rowData.name);
		else {
			alert("请选择一条服务资产！");
		}
		
		if(window.parent.${afterSelected}){
			window.parent.${afterSelected}(rowData.id, rowData.name,rowData);
		}
		
	}
</script>


<div class="box no-border">
	<isperp:tree id="ciCategoryTree" modal="false">
		<isperp:async enable="true"
			url="configuration/ci/getCustomerCiCategoryMenu?customerId=${customerId}">
		</isperp:async>
		<isperp:callback onClick="ciCategoryTree_onNodeClick">
		</isperp:callback>
	</isperp:tree>
	<isperp:grid gridId="ciGrid" cusViewUrl="configuration/ci/ciResumeView"
		ondbClickRowEvent="getSelectRow()"
		url="configuration/ci/listCustomerCi?customerId=${customerId}">
		<jsp:attribute name="searchbar">
		<table class="form-table">
			<tbody>
				<tr>
					<td class="td1">编号：</td>
					<td class="td2"><input type="text" field="code" op="cn">
					</td>
					<td class="td1">名称：</td>
					<td class="td2"><input type="text" field="name" op="cn">
					</td>
				</tr>
			</tbody>
		</table>
		</jsp:attribute>
		<jsp:body>
		<isperp:column name="id" title="id" hidden="true"></isperp:column>
		<isperp:column name="code" title="编号" width="80">
		</isperp:column>
		<isperp:column name="name" title="名称" width="80">
		</isperp:column>
		<isperp:column name="conf_category_name" title="分类" width="100">
		</isperp:column>
		<isperp:column name="status" title="状态" width="60">
		</isperp:column>
		<isperp:column name="use_staff_name" title="使用者" width="80">
		</isperp:column>
 		</jsp:body>
	</isperp:grid>


	<script type="text/javascript">
		function formatCiName(rowObject) {
			return "<a href=\"javascript:isperp.openDialog({contentUrl:'configuration/ci/ciResumeView?id=" + rowObject.id + "'});\">" + rowObject.name + "</a>";
		}
	</script>

</div>
